package com.itmuch.dubbo.user;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itmuch.dubbo.entity.User;
import com.itmuch.dubbo.facade.UserFacade;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Reference
    private UserFacade userFacade;

    @GetMapping("/users/{id}")
    public User findById(@PathVariable Long id) {
        return this.userFacade.findById(id);
    }
}
